.video-player {
  position: relative;
  width: 100%;
  margin: 0 auto;
  background-color: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
}

.video-player.fullscreen {
  max-width: none;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.video-container {
  // position: relative;
  // width: 100%;
  // height: 100%;
  cursor: pointer;
}

.video-container video {
  position: absolute;
  top: 50%;
  left: 50%;
  // width: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  /* 自动适应逻辑 */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
}

.spinner {
  font-size: 2rem;
  color: #fff;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.video-title {
  position: absolute;
  top: 16px;
  left: 16px;
  color: white;
  font-size: 1.2rem;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  z-index: 10;
  max-width: calc(100% - 32px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 16px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-container:hover .video-title {
  opacity: 1;
}

.empty-state {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.empty-icon {
  font-size: 4rem;
  color: white;
  margin-bottom: 16px;
}

.empty-text {
  color: white;
  font-size: 1.2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  padding: 10px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 10;
}

.controls.visible {
  transform: translateY(0);
}

.progress-bar {
  height: 4px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin-bottom: 10px;
  cursor: pointer;
  position: relative;
}

.progress {
  height: 100%;
  background-color: #ff4757;
  border-radius: 2px;
  position: relative;
}

.progress::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-color: #ff4757;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s;
}

.progress-bar:hover .progress::after {
  opacity: 1;
}

.controls-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: auto;
}

.left-controls,
.right-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.control-btn:hover {
  color: #ff4757;
  transform: scale(1.1);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 5px;
}

.volume-slider {
  width: 70px;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  opacity: 0;
  transition:
    opacity 0.2s,
    width 0.2s;
}

.volume-control:hover .volume-slider {
  opacity: 1;
  width: 100px;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #ff4757;
  border-radius: 50%;
  cursor: pointer;
}

.time-display {
  color: white;
  font-size: 0.9rem;
  font-family: monospace;
}

// 音量若隐若现部分
.volume-hint {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 24px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;

  &.visible {
    opacity: 0.8;
    animation: fadeOut 2s forwards;
  }
}

@keyframes fadeOut {
  0% {
    opacity: 0.8;
  }

  100% {
    opacity: 0;
  }
}
